Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

453
Visualizações
Twilio "GCM/FCM unauthorized error: GCM/FCM API key is revoked or invalid" in conversations push notifications

I have implemented a simple chat using Twilio conversations API. I'm following the doc for web push notifications (https://www.twilio.com/docs/conversations/javascript/push-notifications-web) and it's not clear to me what "FCM SECRET" I need to include in my Twilio Credential. I have tried with my firebase app key pair (public and private) and also with firebase web API key, but in the Twilio logs I allways get a GCM/FCM unauthorized error: GCM/FCM API key is revoked or invalid error.

Update:

My app code:

import { initializeApp } from "https://www.gstatic.com/firebasejs/9.8.2/firebase-app.js";
import { getMessaging, getToken, onMessage } from "https://www.gstatic.com/firebasejs/9.8.2/firebase-messaging.js";

const firebaseConfig = {
    apiKey: "...",
    authDomain: "...",
    projectId: "...",
    storageBucket: "...",
    messagingSenderId: "...",
    appId: "..."
};

const firebase = initializeApp(firebaseConfig);
const messaging = getMessaging(firebase);

const serviceWorkerRegistration = await navigator
    .serviceWorker
    .register('/js/firebase/firebase-messaging-sw.js');

if (firebase && messaging) {

    // getting FCM token
    getToken(messaging, {
        vapidKey: '...',
        serviceWorkerRegistration: serviceWorkerRegistration,
    }).then(async (fcmToken) => {

        console.log('token', fcmToken)
        const conversationsClient = await getConversationsClient();

        conversationsClient.setPushRegistrationId('fcm', fcmToken);

        onMessage(messaging, payload => {
            console.log('Message received. ', payload);
            conversationsClient.handlePushNotification(payload);
        });

    }).catch((err) => {
        console.log('Error getting token', err);
    });

} else {
    // no Firebase library imported or Firebase library wasn't correctly initialized
}

The fcmToken is generated and successfuly registered in Twilio.

The Binding is created In Twilio with my credential referenced:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I believe the FCM Secret should be the apiKey that you get when you register the web application and get the details like this:

Screenshot of the Firebase setup process showing the section where you add the Firebase SDK to your application. The first key in the Firebase Config is the apiKey.

You also need to ensure you are using that config when you initialize the Firebase SDK in your application.

If you are using that config, then perhaps you can share the code that you are using in your app to initialize Firebase and request an fcmToken from the user.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda